home *** CD-ROM | disk | FTP | other *** search
/ Enter 2003: The Beautiful Scenery / enter-parhaat-2003.iso / files / frendz.exe / frendz.dcr / Scripts_59_Dynamic Banners.ls < prev    next >
Encoding:
Text File  |  2002-12-31  |  2.7 KB  |  96 lines

  1. global resultsList, currentID, GAME_ID, gBannerList, gFlashBanner, gGoodNetBanner
  2.  
  3. on getNewBanner
  4.   the actorList = []
  5.   gBannerList = [:]
  6.   gGoodNetBanner = 0
  7.   member("f_reciveText").text = EMPTY
  8.   resultsList = []
  9.   currentID = 0
  10.   thisURL = "http://www.kewlbox.com/ping/getBanner.cfm?gameId=" & GAME_ID
  11.   thisObj = new(script("cfmRetreive"), thisURL, "f_reciveText", 0)
  12. end
  13.  
  14. on newBannerType
  15.   bannerName = getProp(gBannerList, #banneraddress)
  16.   if bannerName <> "Default" then
  17.     member("Other Client Ads").fileName = bannerName
  18.     gGoodNetBanner = 1
  19.   end if
  20. end
  21.  
  22. on processResults thisText, thisFieldName, recordData
  23.   oldDelims = the itemDelimiter
  24.   the itemDelimiter = "\"
  25.   if voidp(recordData) then
  26.     recordData = 0
  27.   end if
  28.   member(thisFieldName).text = EMPTY
  29.   if recordData then
  30.     resultsList = []
  31.   end if
  32.   thisLimit = thisText.line.count
  33.   linesAdded = 0
  34.   repeat with index = 1 to thisLimit
  35.     thisLine = thisText.line[index]
  36.     if thisLine <> EMPTY then
  37.       if recordData then
  38.         thisTitle = thisLine.item[1]
  39.         thisID = integer(thisLine.item[2])
  40.         thisList = [thisTitle, thisID]
  41.         append(resultsList, thisList)
  42.       else
  43.         thisTitle = thisLine
  44.       end if
  45.       thisTitle = Trim(thisTitle)
  46.       if (charToNum(thisTitle.char[1]) <> 13) and (thisTitle.chars.count <> 0) then
  47.         linesAdded = 1
  48.         member(thisFieldName).text = member(thisFieldName).text & thisTitle & RETURN
  49.       end if
  50.     end if
  51.   end repeat
  52.   if linesAdded then
  53.     member(thisFieldName).text = member(thisFieldName).text
  54.   else
  55.     member(thisFieldName).text = "Default"
  56.   end if
  57.   member(thisFieldName).scrollTop = 0
  58.   the itemDelimiter = oldDelims
  59.   l = the number of lines in the text of member "f_reciveText"
  60.   z = 1
  61.   repeat with i = 1 to l
  62.     if member("f_reciveText").line[i] <> " " then
  63.       addProp(gBannerList, getPropAt([#banneraddress: 1, #clicktolink: 2, #fileType: 3, #extra: 4], z), member("f_reciveText").line[i])
  64.       z = z + 1
  65.     end if
  66.   end repeat
  67.   newBannerType()
  68. end
  69.  
  70. on Trim thisLine
  71.   tempLine = thisLine
  72.   if tempLine <> EMPTY then
  73.     doneTrim = 0
  74.     counter = 0
  75.     repeat while not doneTrim
  76.       counter = counter + 1
  77.       thisChar = tempLine.char[counter]
  78.       if (thisChar <> TAB) and (thisChar <> " ") then
  79.         tempLine = tempLine.char[counter..tempLine.chars.count]
  80.         exit repeat
  81.       end if
  82.     end repeat
  83.     doneTrim = 0
  84.     counter = tempLine.chars.count
  85.     repeat while not doneTrim
  86.       thisChar = tempLine.char[counter]
  87.       if (thisChar <> TAB) and (thisChar <> " ") then
  88.         tempLine = tempLine.char[1..counter]
  89.         exit repeat
  90.       end if
  91.       counter = counter - 1
  92.     end repeat
  93.   end if
  94.   return tempLine
  95. end
  96.